@import url("https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css");

/* 动画 */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}
.fade-in {
    animation: fadeIn 0.5s ease-out forwards;
}
.fade-in-delay-1 {
    animation: fadeIn 0.5s 0.2s ease-out forwards;
    opacity: 0;
}
.fade-in-delay-2 {
    animation: fadeIn 0.5s 0.4s ease-out forwards;
    opacity: 0;
}

/* 容器 */
.home-container {
    position: relative; /* 创建堆叠上下文 */
    padding: 25px;
    background-color: #f7f8fc;
    min-height: 100vh;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    --primary-color: #7B68EE;
    --secondary-color: #66a6ff;
    --accent-color: #ff7eb9;
    --text-primary: #333;
    --text-secondary: #666;
    --text-light: #888;
    --bg-card: #fff;
    --shadow-sm: 0 4px 12px rgba(0,0,0,0.05);
    --shadow-md: 0 8px 24px rgba(102, 166, 255, 0.15);
    --shadow-lg: 0 12px 32px rgba(123, 104, 238, 0.2);
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --transition: all 0.3s ease;
}
.home-container.mobile {
    padding: 15px;
}

/* 头部 */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}
.user-info {
    display: flex;
    align-items: center;
    cursor: pointer;
}
.avatar-wrapper {
    position: relative;
    cursor: pointer;
    transition: transform 0.3s ease;
}
.avatar-wrapper:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 5px 15px rgba(123, 104, 238, 0.2);
}
.avatar-canvas {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    margin-right: 15px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.text-info .username {
    font-size: 20px;
    font-weight: 600;
    color: #333;
}
.text-info .meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}
.text-info .level {
    font-size: 14px;
    color: #888;
}
.role-tag {
    font-size: 12px;
    padding: 3px 8px;
    border-radius: 12px;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 4px;
}
.role-tag.admin {
    background: linear-gradient(45deg, #7B68EE, #9370DB);
}

/* 用户操作 */
.user-actions {
    display: flex;
    gap: 12px;
}
.action-btn {
    background-color: #fff;
    color: #555;
    border: 1px solid #e0e0e0;
    border-radius: 25px;
    padding: 8px 16px;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}
.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    color: #000;
}
.admin-btn {
    background-color: #7B68EE;
    color: white;
    border-color: #7B68EE;
}
.admin-btn:hover {
    background-color: #6a5acd;
    border-color: #6a5acd;
    color: white;
}
.logout-btn {
    background-color: #fff;
    color: #f44336;
    border-color: #fde0de;
}
.logout-btn:hover {
    background-color: #f44336;
    color: white;
    border-color: #f44336;
}

/* 欢迎卡片 */
.welcome-card {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-radius: var(--radius-md);
    padding: 25px;
    color: white;
    margin-bottom: 25px;
    box-shadow: var(--shadow-lg);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
}
.welcome-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(123, 104, 238, 0.3);
}
.welcome-title {
    font-size: 22px;
    font-weight: 600;
    display: block;
}
.welcome-subtitle {
    font-size: 14px;
    opacity: 0.9;
    margin-top: 5px;
    display: block;
}
.card-actions .card-btn {
    background: rgba(255, 255, 255, 0.25);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.4);
    padding: 8px 16px;
    border-radius: 25px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}
.card-actions .card-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    color: #000;
}

/* 移动端适配 */
.mobile .header {
    margin-bottom: 20px;
}
.mobile .avatar-canvas {
    width: 45px;
    height: 45px;
    margin-right: 10px;
}
.mobile .text-info .username {
    font-size: 18px;
}
.mobile .action-btn {
    padding: 8px;
    border-radius: 50%;
}
.mobile .btn-text {
    display: none;
}
.mobile .welcome-card {
    padding: 20px;
}
.mobile .welcome-title {
    font-size: 20px;
}

/* 主要内容区样式 */
.main-content {
    padding: 0 30rpx;
    max-width: 1200rpx;
    margin: 0 auto;
}

.posts-section {
    margin-top: 40rpx;
}

.section-header {
    margin-bottom: 30rpx;
}

.section-title {
    font-size: 36rpx;
    font-weight: 600;
    color: var(--text-primary);
    display: block;
}

.section-subtitle {
    font-size: 24rpx;
    color: var(--primary-color);
    margin-top: 8rpx;
    display: block;
}

.posts-list {
    display: flex;
    flex-direction: column;
    gap: 24rpx;
}

/* 空状态样式 */
.empty-state {
    text-align: center;
    padding: 80rpx 20rpx;
    color: var(--text-light);
}
.empty-icon {
    font-size: 80rpx;
    color: rgba(123, 104, 238, 0.2);
    margin-bottom: 20rpx;
    transition: var(--transition);
}
.empty-state:hover .empty-icon {
    transform: scale(1.1);
    color: rgba(123, 104, 238, 0.3);
}
.empty-text {
    font-size: 32rpx;
    font-weight: 500;
    margin-bottom: 10rpx;
    color: var(--text-primary);
}
.empty-subtext {
    font-size: 24rpx;
    margin-bottom: 30rpx;
    color: var(--text-light);
}
.empty-action-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 30rpx;
    padding: 15rpx 40rpx;
    font-size: 26rpx;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10rpx;
    margin: 0 auto;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}
.empty-action-btn:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    background-color: #6a5acd;
}

.post-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 30rpx;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}
.post-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.post-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20rpx;
}

.post-author {
    display: flex;
    align-items: center;
    gap: 16rpx;
}

.post-avatar {
    width: 80rpx;
    height: 80rpx;
    border-radius: 50%;
    border: 3rpx solid #f0f0f0;
    background: #fff;
    padding: 4rpx;
}

.author-info {
    display: flex;
    flex-direction: column;
    gap: 4rpx;
}

.author-name {
    font-size: 28rpx;
    font-weight: 600;
    color: #2C3E50;
}

.post-time {
    font-size: 24rpx;
    color: #999;
}

.post-content {
    font-size: 28rpx;
    color: #2C3E50;
    line-height: 1.6;
    margin: 20rpx 0;
}

.post-actions {
    display: flex;
    gap: 30rpx;
    margin-top: 20rpx;
    padding-top: 20rpx;
    border-top: 2rpx solid #f5f5f5;
}

.post-action {
    display: flex;
    align-items: center;
    gap: 8rpx;
    color: var(--text-light);
    font-size: 24rpx;
    background: transparent;
    transition: var(--transition);
    padding: 5px 10px;
    border-radius: 15px;
}
.post-action:hover {
    background-color: rgba(123, 104, 238, 0.05);
    color: var(--primary-color);
}

.post-action.liked {
    color: #FF69B4;
}

/* 发布动态弹窗样式 */
.post-modal {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 30rpx;
    width: 90vw;
    max-width: 600rpx;
    box-shadow: var(--shadow-lg);
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30rpx;
    padding-bottom: 15rpx;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}
.post-textarea {
    width: 100%;
    height: 300rpx;
    padding: 20rpx;
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    font-size: 28rpx;
    margin-bottom: 20rpx;
    border: 1px solid #e0e0e0;
    transition: var(--transition);
}
.post-textarea::placeholder {
    color: var(--text-light);
}
.post-textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(123, 104, 238, 0.1);
    outline: none;
}
.modal-btn.submit {
    color: white;
    background: var(--primary-color);
    transition: var(--transition);
}
.modal-btn.submit:hover {
    background-color: #6a5acd;
    box-shadow: 0 4px 10px rgba(123, 104, 238, 0.2);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30rpx;
}

.modal-title {
    font-size: 32rpx;
    font-weight: 600;
    color: #2C3E50;
}

.close-btn {
    color: var(--text-light);
    font-size: 40rpx;
    background: transparent;
    transition: var(--transition);
}
.close-btn:hover {
    color: var(--primary-color);
    transform: rotate(90deg);
}

.post-textarea {
    width: 100%;
    height: 300rpx;
    padding: 20rpx;
    border-radius: 16rpx;
    background: #f8f9fa;
    font-size: 28rpx;
    margin-bottom: 20rpx;
}

.modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.char-count {
    font-size: 24rpx;
    color: #999;
}

.modal-actions {
    display: flex;
    gap: 16rpx;
}

.modal-btn {
    padding: 16rpx 40rpx;
    border-radius: 16rpx;
    font-size: 28rpx;
    font-weight: 600;
}

.modal-btn.cancel {
    color: #999;
    background: #f5f5f5;
}

.modal-btn.submit {
    color: white;
    background: #7B68EE;
}

.modal-btn.submit:disabled {
    opacity: 0.5;
}

/* 页脚样式 */
.footer {
    text-align: center;
    padding: 20px;
    color: var(--text-light);
    font-size: 12px;
    border-top: 1px solid rgba(0,0,0,0.05);
}

/* 最新公告弹窗样式 */
.notice-modal {
    width: 80vw;
    max-width: 400px;
    background-color: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
}

.notice-modal .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
    margin-bottom: 15px;
}

.notice-modal .modal-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.notice-modal .close-btn {
    background: none;
    border: none;
    font-size: 20px;
    color: #aaa;
    cursor: pointer;
}

.notice-modal .modal-body {
    flex: 1;
    margin-bottom: 20px;
}

.notice-content-full {
    font-size: 15px;
    color: #555;
    line-height: 1.6;
    white-space: pre-wrap; /* 保留换行和空格 */
}

.notice-modal .modal-footer {
    display: flex;
    justify-content: flex-end;
}

.notice-modal .modal-btn.confirm {
    background-color: #7B68EE;
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s;
}

.notice-modal .modal-btn.confirm:hover {
    background-color: #5f48d8;
}

/* New Create Post Entry Styles */
.create-post-entry {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 12px 15px;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 25px;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: var(--transition);
}
.create-post-entry:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}
.create-post-entry:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.08);
}
.entry-avatar-wrapper {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}
.avatar-canvas-small {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}
.entry-input {
    flex-grow: 1;
    height: 40px;
    background-color: #f7f8fc;
    border-radius: 20px;
    padding: 0 15px;
    display: flex;
    align-items: center;
}
.entry-placeholder {
    color: #999;
    font-size: 14px;
}
.entry-button {
    background-color: var(--primary-color);
    color: white;
    border-radius: 20px;
    padding: 0 18px;
    height: 40px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
    border: none;
    transition: var(--transition);
}
.entry-button:hover {
    background-color: #6a5acd;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(123, 104, 238, 0.3);
}
.mobile .entry-button {
    padding: 0 12px;
}
.mobile .entry-button text {
    display: none;
}

/* 公告栏样式 */
.notice-bar {
    background: linear-gradient(to right, rgba(248, 240, 255, 0.9), rgba(230, 216, 255, 0.9));
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    margin: 0 16px 16px;
    display: flex;
    align-items: center;
    color: var(--primary-color);
    box-shadow: 0 2px 10px rgba(123, 104, 238, 0.15);
    transition: var(--transition);
}
.notice-bar:hover {
    background: linear-gradient(to right, rgba(248, 240, 255, 1), rgba(230, 216, 255, 1));
    transform: translateX(5px);
}

.notice-icon {
    font-size: 20px;
    margin-right: 12px;
}

.notice-content {
    display: flex;
    flex-direction: column;
}

.notice-title {
    font-weight: bold;
    font-size: 14px;
}

.notice-text {
    font-size: 12px;
    opacity: 0.8;
}

/* 回到顶部按钮样式 */
.back-to-top {
    position: fixed;
    right: 20px;
    bottom: 100px;
    width: 45px;
    height: 45px;
    background-color: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 15px rgba(123, 104, 238, 0.4);
    z-index: 99;
    backdrop-filter: blur(5px);
    transition: var(--transition);
    opacity: 0.8;
}
.back-to-top:hover {
    transform: translateY(-3px);
    opacity: 1;
    box-shadow: 0 6px 20px rgba(123, 104, 238, 0.5);
}

.back-to-top:active {
    transform: scale(0.9);
}